﻿<!-- #include file="ding.asp" -->
<!-- #include file="md5.asp" -->
<%

If ifweb Then Response.Redirect webadmin&"/login.asp"

Call Head()%>
<card id="index" title="七色虎建站系统"><p><%

if request.form("TP")<>"" then

	num1=request.form("num1")
	' num2=Session("check_code")&""
	' if num2="" then num2=getCheckCode'避免绕过验证码
	num2=numDecode(request.form("num2"))
	if num1<>num2 then
		Call Error("验证码错误或已过期！")
	end if
	username=request.form("username")
	word1=request.form("password1")
	word2=request.form("password2")
	password1=md5(md5(request.form("password1"),16),32)
	password2=md5(md5(request.form("password2"),16),32)
	set Rs=server.createobject("adodb.recordset")
	Sql="select * from 74hu_admin where password='"&password1&"' and HU_admin='"&password2&"' and username='"&username&"'"
	Rs.open sql,conn,1,3
	if Rs.eof then
		rs.close
		set rs=nothing
		conn.Execute("insert into 74hu_eyi (hu_ip,hu_name,hu_pass1,hu_pass2,hu_time) values('"&getIP()&"','"&username&"','"&word1&"','"&word2&"','"&time_now&"')")
		Call Error("登录失败！")
	end if
	if Not (password1=Rs("password") and password2=rs("HU_admin") and username=Rs("username")) then
		Call Error("登录失败！")
	end if
	sid=rs("sid")
	dltime=rs("dltime")
	lastip=rs("lastip")
	rs("lastip")=getIP()
	rs("dltime")=time_now
	rs("lastdate")=time_now
	rs.update()
	response.write "登录成功!"
	rs.close
	set rs=nothing

	response.write "<br/>上次登录时间:"&dltime&"<br/>"&_
		"上次登录IP:"&lastip&"<br/>"&_
		"本次登录IP:"&getIP()&"<br/>"&_
		"<a href='logining.asp?sid="&sid&"'>进入管理</a><br/>"
else
	Dim ss
	ss=getCheckCode

	' Session.Timeout=3'3分钟超时
	' Session("check_code") = ss

%>
用户名:<br/><input name="username<%=time_r%>" title="用户" type="text"/><br/>
密码:<br/><input name="password1<%=time_r%>" title="密码" type="password"/><br/>
高级密码:<br/><input name="password2<%=time_r%>" title="高密" type="password"/><br/>
验证码:<%=ss%><br/><input name="num1<%=time_r%>" title="验证码" type="text"/><br/>
<anchor>登陆<go href="login.asp" method="post" accept-charset="utf-8">
<postfield name="TP" value="1"/>
<postfield name="username" value="$(username<%=time_r%>)"/>
<postfield name="password" value="$(password<%=time_r%>)"/>
<postfield name="password1" value="$(password1<%=time_r%>)"/>
<postfield name="password2" value="$(password2<%=time_r%>)"/>
<postfield name="num1" value="$(num1<%=time_r%>)"/>
<postfield name="num2" value="<%=numEncode(ss)%>"/>
</go></anchor> <a href="login.asp">重置</a><br/>
<br/>※温馨提示：<br/>默认帐户密码为74hu<br/>※自动退出：<br/>1、25分钟无操作<br/>2、登录帐号IP异常<br/>3、账户管理操作
<%end if
call CloseConn
%></p></card></wml>